/*
 * Created on 2005/04/26
 * Author aki@www.xucker.jpn.org
 * License Apache2.0 or Common Public License
 */
package jp.sourceforge.akjrcp.snack;

/**
 * 
 *
 */
public class Spectrogram {
private int height;
public int getHeight() {
    return height;
}
public void setHeight(int height) {
    this.height = height;
}
public int getPerSample() {
    return persample;
}
public void setPerSample(int permillisecond) {
    this.persample = permillisecond;
}
public int[] getRawInt() {
    return rawInt;
}
public void setRawInt(int[] rawInt) {
    this.rawInt = rawInt;
}
public int getSamplerate() {
    return samplerate;
}
public void setSamplerate(int samplerate) {
    this.samplerate = samplerate;
}
private int samplerate;
private int persample;

public double toMillisecond(){
   return 1000*getWidth()*persample/samplerate;
}
public int getMaxHertz(){
    if(samplerate!=0){
        return samplerate/2;
    }else{
        return 0;
    }
    
}

public int getWidth(){
    if(rawInt.length>0){
    return rawInt.length/height;
    }else{
        return 0;
    }
}

public int getValueAt(int x,int y){
return rawInt[height*x+y];    
}

/*
 * in this time dont' use.
//private double[] rawDouble;
public double getDoubleAt(int x,int y){
    return rawDouble[height*x+y];
}*/

private int[] rawInt=new int[0];


}
